/*  ----------------------------------------------------------------------------
 *  Arello Mobile
 *  Fast 3d Engine
 *  ----------------------------------------------------------------------------
 * Except where otherwise noted, this work is licensed under
 * http://creativecommons.org/licenses/by/3.0
 */

#ifndef LIB2D_GUI_CHECKBOX_H
#define LIB2D_GUI_CHECKBOX_H

#include "Button.h"

namespace liba
{
namespace lib2d
{
namespace gui
{

class CheckBox : public Button
{
protected:
	bool checked;
public:
	CheckBox( Object * parent, const Rect & rect = Rect( 0, 0, 0, 0 ) );
	virtual ~CheckBox();

	virtual bool on_attribute( xml::Provider * prov, const std::string & name, const std::string & value );
	virtual void on_button_up( const Vector2 & point, const Atom & button_name );

	bool is_checked()const
	{
		return checked;
	}
	void set_check( bool check = true )
	{
		checked = check;
	}
};

} //namespace gui
} //namespace lib2d
} //namespace liba

using namespace liba;

#endif //LIB2D_GUI_CHECKBOX_H

